package com.ssy.lingxi.logistics.entity;

import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 物流公司实体类
 *
 * @author yzc
 * @version 2.0.0
 * @date 2020/7/10
 */
@Data
@Entity
@Table(schema = "public", name = "ls_logistics_company",
        indexes = {@Index(name = "ls_logistics_company_member_id_idx", columnList = "memberId"),
                @Index(name = "ls_logistics_company_role_id_idx", columnList = "roleId")})
public class Company implements Serializable {

    private static final long serialVersionUID = -8962980252233409933L;

    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "logistics_company_seq")
    @SequenceGenerator(sequenceName = "ls_logistics_company_seq", name = "logistics_company_seq", allocationSize = 1)
    private Long id;

    /**
     * 物流公司名称
     */
    @Column(columnDefinition = "varchar(40)")
    private String name;

    /**
     * 物流公司编码
     */
    @Column(columnDefinition = "varchar(20)")
    private String code;

    /**
     * 物流公司会员id
     */
    @Column
    private Long companyMemberId;

    /**
     * 物流公司角色id
     */
    @Column
    private Long companyRoleId;

    /**
     * 合作类型 1-平台物流服务商 2-商户合作物流公司
     */
    @Column
    private Integer cooperateType;

    /**
     * 状态 0-无效 1-有效
     */
    @Column
    private Integer status;

    /**
     * 排序字母
     */
    @Column(columnDefinition = "varchar(4)")
    private String sort;

    /**
     * 备注
     */
    @Column(columnDefinition = "varchar(60)")
    private String remark;

    /**
     * 数据关联会员id
     */
    @Column
    private Long memberId;

    /**
     * 数据关联角色id
     */
    @Column
    private Long roleId;

    /**
     * 创建时间
     */
    @Column
    private Long createTime;
}
